<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>v-model 指令</title>
		<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
	</head>
	<body>
		<div id="app">
			<input type="button" value="修改message" @click="setM" />
			<input type="text" v-model="message" @keyup.enter="getM" />
			<h2>{{message}}</h2>
			
		</div>
		
		<script type="text/javascript">
			var app = new Vue({
				el: "#app",
				data:{
					message:"小浩程序员"
				},
				methods:{
					getM:function(){
						alert(this.message);
					},
					setM:function(){
						this.message = "小小浩"
					}
				}
			})
		</script>
	</body>
</html>
